﻿using StbImageSharp;

namespace TrinityEngine
{
    public static class TextureLoader
    {
        static TextureLoader()
        {
            StbImage.stbi_set_flip_vertically_on_load(1);
        }

        public static Texture2D Load(string fileName)
        {
            ImageResult image = ImageResult.FromStream(File.OpenRead(fileName), ColorComponents.RedGreenBlueAlpha);
            return new Texture2D(image.Data, image.Width, image.Height);
        }
    }
}
